<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>

	<xsl:template match="/">
		<html>
			<head>
				<style>.n1,.n2,.n3,.n4,.n5,.n6,.n7,.n8,.n9,.n10{
		width:30px;
		text-align:center;
	}
	.n1,.n2,.n3,.n4{
	color:red;
	}
	.n5,.n6,.n7{
	color:green;
	}
	.n8,.n9,.n10{
	color:blue;
	}
	table #notasTable{
	font-family:arial;
	font-size:10px;
	}
	#notasTable thead{
	font-family:arial;
	font-size:10px;
	background: #FCD387;
	text-align:center;
	}
	.Alumno{
	font-size:12px;
	}
	td{
	border:solid 1px gray;
	
	}
	.detallenotas{
	font-size:10px;
	width:100px;
	}
	.notaNombre{
		width:50px;
		height:20px;
		overflow:hidden;
	}
	.ItemNota{
		width:50px;
		height:20px;
		overflow:hidden;
	}
	.periodoactual{
	background: #FEF0D6;
	text-align:center;
	}
	.promedioGral{
	background: #FCD387;
	text-align:center;
	font-size:16px;
	}</style>
				<script language="javascript">function modificarNotas(){
		window.open("DetalleNotaAlumnoInglesNro.aspx");
		//alert("Modificar las notas de "+ Nombre);
	}</script>
			</head>
			<body>
				<table id="notasTable">
					<thead>
						<td style="width:250px;">Alumno</td>
						<xsl:for-each select="alumnos/alumno[1]/periodos/periodo">
							<td>
								<xsl:value-of select="@name"/>
							</td>
						</xsl:for-each>
						<td>Notas</td>
						<td>Observaciones</td>
					</thead>
					<xsl:for-each select="alumnos/alumno">
						<tr class="alumno">
							<td>
								<xsl:value-of select="@nombre"/>
							</td>
							<xsl:apply-templates select="periodos/periodo"></xsl:apply-templates>
							<xsl:apply-templates select="notas"></xsl:apply-templates>
							<td>&#xA0;<xsl:value-of select="observacion"></xsl:value-of></td>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>

	<!--PERIODOS-->
	<xsl:template match="periodos/periodo">
		<td>
			<xsl:if test="@actual">
				<xsl:attribute name="class">periodoactual</xsl:attribute>
			</xsl:if>
			<xsl:if test="@resumen">
				<xsl:attribute name="class">promedioGral</xsl:attribute>
			</xsl:if>
			<span>
				<xsl:attribute name="class">n<xsl:value-of select="round(.)"/></xsl:attribute>
				<xsl:call-template name="NotaNumero"/>
			</span>
		</td>
	</xsl:template>
	<!--PERIODOS-->



	<!-- detalle de notas -->
	<xsl:template match="notas">
		<td>
			<table class="detallenotas">
				<xsl:for-each select="nota">
					<tr>
						<xsl:attribute name="title">
							<xsl:value-of select="@name"/>
						</xsl:attribute>
						<xsl:apply-templates select="item[1]"/>
					</tr>
				</xsl:for-each>
				<tr>
					<td colspan="2" align="center">
						<a href="#" onclick="modificarNotas();">Editar</a>
						<!-- <xsl:value-of select="parent::node()/@idAlumno"/>-->
					</td>
				</tr>
			</table>
		</td>
	</xsl:template>
	<!-- Fin detalle de notas -->


	<!-- nota item -->
	<xsl:template match="item">
		<td>
		<xsl:value-of select="parent::node()/@name"/>
		</td>
		<td>
			<div style="text-align:center">
				<xsl:attribute name="title">
					<xsl:value-of select="parent::node()/@name"/>/<xsl:value-of select="@detalle"/></xsl:attribute>
				<xsl:attribute name="class">n<xsl:value-of select="round(.)"/></xsl:attribute>
				<xsl:attribute name="value">
					<xsl:value-of select="."/>
				</xsl:attribute>
				<xsl:call-template name="NotaNumero"/>
			</div>
		</td>
	</xsl:template>

	<xsl:template name="NotaNumero">
		<xsl:variable name="notaNumero">
			<xsl:value-of select="round(.)"/>
		</xsl:variable>
		<xsl:value-of select="//letra/nota[@valor=$notaNumero]/parent::node()/@valor"></xsl:value-of>
	</xsl:template>
	<!-- nota item -->
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2004. Sonic Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="ResumenNotas" userelativepaths="yes" externalpreview="no" url="NotasIngles.xml" htmlbaseurl="" outputurl="" processortype="internal" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->